<!--
**********************************************************
* @Author: 张小平
* @Date:   2024-05-01
* @Email:  qqshuqian@163.com
* @Last modified: 最后修改日期
* @Description: 文件描述
**********************************************************
-->
<template>
  <el-dialog
  :title="title"
  append-to-body
  fullscreen
  modal="false"
  :modelValue="visible"
  :before-close="handleClose">
  <div class="warp" :style="{height: `${height}px`}">
    <iframe :src="url" class="iframe" ref="iframe" height="100%"></iframe>
  </div>
  </el-dialog>
</template>

<script>
export default {
  props: {
    visible: {
      type: Boolean, // sync
      default: false
    },
    title: {
      type: String,
      default: '编辑文件'
    },
    url: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      height: 0
    }
  },
  mounted() {
    this.height = document.body.clientHeight - 54
  },
  methods: {
    handleClose() {
      this.$emit('on-close')
      this.$emit('onUpdateVisible', false)
    }
  }
}
</script>

<style lang="scss" scoped>
::v-deep(.el-dialog__body){
  border-top: 1px solid #EBEEF5;
  padding: 0;
}
.warp {

}
.iframe {
  width: 100%;
  border: 0;
  overflow: hidden;
  box-sizing: border-box;
}
</style>
